{% extends "base.html" %}
{% load static %}
{% load web_extras %}

{% block head %}
	{{ block.super }}
	{% if not upload or upload.is_processing %}
		<meta http-equiv="refresh" content="3"/>
	{% endif %}
{% endblock %}

{% block title %}Your Upload{% endblock %}

{% block content %}

<div class="upload-status-message upload-{{ upload.status.name|lower }}">
{% if not upload %}
	<p>
		Your replay is still uploading. Hold on!<br/>
		<small><em>Hmm. Or maybe something went wrong&hellip;</em></small>
	</p>
	{% setting 'HSREPLAY_TWITTER_HANDLE' as twitter_handle %}
	{% if twitter_handle %}
		<p>
			<small><a href="https://twitter.com/{{ twitter_handle }}">Follow us on Twitter</a> for maintenance announcements.</small>
		</p>
	{% endif %}
{% elif upload.is_processing %}
	<p>Your replay is still processing. Check back soon!</p>
{% elif upload.status.name == "UNSUPPORTED" %}
	<p>
		<strong>This replay is not supported.</strong><br/>
		<em>{{ upload.error }}</em>
	</p>
{% elif upload.status.name == "VALIDATION_ERROR" %}
	<p>
		<strong>The uploaded file is not a valid replay.</strong><br/>
		<em>{{ upload.error }}</em>
	</p>
{% elif upload.status.name == "UNSUPPORTED_CLIENT" %}
	<strong>Your version of Hearthstone Deck Tracker is too old!</strong>
	<div style="margin: 1em auto; font-size: 0.7em; max-width: 800px;">
		<p>
			Thanks to the help of our beta testers, newer versions of HDT have received
			a plethora of bug fixes. The version you are using is no longer supported.<br/>
			<a href="{% setting 'HDT_DOWNLOAD_URL' %}">Download the latest version here</a>.
		</p>
	</div>
{% else %}
	<p>Something went wrong generating this replay. We're on it.</p>
{% endif %}
{% if user.is_staff and upload %}
	<p><a href="{% url 'admin:uploads_uploadevent_change' upload.id %}">View in admin</a></p>
{% endif %}
</div>

{% endblock %}
